<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>内容展示页</title>
  <link rel="stylesheet" type="text/css" href="http://127.0.0.1/my/wasai/Static/hdjs/hdjs.css">
  <script type="text/javascript" src="http://127.0.0.1/my/wasai/Static/Js/jquery-1.7.2.min.js"></script>
  <script src="http://127.0.0.1/my/wasai/Static/hdjs/hdjs.min.js" type="text/javascript" charset="utf-8"></script>
  <script src="http://127.0.0.1/my/wasai/Static/public/js/index.js" type="text/javascript" charset="utf-8"></script>
  <link rel="stylesheet" type="text/css" href="http://127.0.0.1/my/wasai/Static/public/content.css">
  <link rel="stylesheet" type="text/css" href="http://127.0.0.1/my/wasai/Static/public/index.css">
  <script type="text/javascript">
  	$(function(){
  		$('.spec li').click(function(){
  			$(this).parents('ul').find('a').removeClass('green');
			$(this).find('a').addClass('green');
			$(this).siblings().find('input').removeAttr('checked');
			//点击中两个之后做处理
			if($('.green').length>=2){
				var combine = '';
				$.each($('.green'), function() {    
					 combine += $(this).attr('spec') + ',';                                                       
				});
				
				$.ajax({
					type:"post",
					url:"<?php echo U('Index/Goods/index');?>",
					data:{combine:combine},
					dataType:'json',
					success:function(phpData){
						if(phpData){
							num=Number(phpData);
							$('.num').html(num);
						}else{
							alert('sorry！该规格下没有货存~');
						}
						
					}
				});
			}
  		})
  		
  		
  		
  		//点击加入购物车
		$('.joincat').click(function(){
			
			if($('.green').length>=2){
				$('.join1').css({'display':'block'});
				var gid=$('#gid').val();
	  			var name=$('#name').val();
	  			var price=$('#price').val();
	  			var shopnum=$('.number').val();
	  			var options='';
	  			$.each($('.green'), function() {    
					options += $(this).attr('spec') + ',';
				});
				$.ajax({
					type:"post",
					url:"<?php echo U('Index/Shop/index');?>",
					data:{gid:gid,name:name,price:price,shopnum:shopnum,options:options},
					dataType:'json',
					success:function(phpData){
						var numb=(phpData.numb);
						var total=(phpData.total);
						$('.shuliang').html(numb);
						$('.zongjia').html(total);
						$('.zongshuliang').html(numb);
					}
				});
				
			}else{
				alert('请选择商品规格!');
			}
			
			
			
		})
  		
  		
  		$('.guanbi').click(function(){
  			$('.join1').css({'display':'none'});
  		})
  		
  		$('.shop .a1').click(function(){
  			var num=$('.number').val();
  			num=Number(num);
  			if(num==1){
  				$('.number').val(num);
  			}else{
  				$('.number').val(--num);
  			}
  		})
  		$('.shop .a2').click(function(){
  			var num=$('.number').val();
  			num=Number(num);
  			$('.number').val(++num);
  		})
  		
  		
  		
  	})
  </script>
  <style type="text/css">
     .spec{
     	margin-top: 10px;
     }
    .spec li{
    	float: left;
    	width: auto;
    	height: 24px;
    	color: #5C5C5C;
    	font-size: 12px;
    	line-height: 10px;
    	font-family: "微软雅黑";
    }
  	.spec li a{
  		width: auto;
  		height: 24px;
  		color: #5C5C5C;
  		font-size: 12px;
    	line-height: 22px;
    	font-family: "微软雅黑";
    	display: block;
    	margin-left: 10px;
    	padding: 2px 8px 2px 8px;
    	border: solid 2px #C8C9CE;
  	}
  	.spec li a:hover{
  		border: solid 2px #77B500;
  	}
  	.spec li .green{
  		border: solid 2px #77B500;
  	}
  	.speak{
  		color: #5C5C5C;
  	}
  	.speak:hover{
  		color: #479CB4;
  	}
  </style>
</head>

<body>
    <?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!--顶部开始-->
    <div class="top">
    	<div class="top1">
    	   <div class="top3">
    	   	<?php if(isset($_SESSION['uid']) || isset($_SESSION['nicname'])){ ?>
    	   	 <ul class="denglu one">
    			<li class="li1" style="width: 8px;">
    				<a href="<?php echo U('Index/Geren/index');?>"><img src="http://127.0.0.1/my/wasai/<?php echo $_SESSION['hearimg'];?>" alt="" style="width: 30px;height: 30px;position: relative;left: -8px;top: 7px;"/></a>
    			</li>
    			<li class="li2"><span><?php echo $_SESSION['nicname'];?></span>&nbsp;&nbsp;&nbsp;<a href="<?php echo U('Index/Login/out');?>">退出</a></li>
    		  </ul>
    	   	 <?php }else{ ?>
    		 <ul class="denglu">
    			<li class="li1"><a href="<?php echo U('Index/Login/denglu');?>">登陆</a></li>
    			<li class="li2"><a href="<?php echo U('Index/Login/index');?>">注册</a></li>
    		 </ul>
    		 <?php } ?>
    		 <ul class="gowu">
    		 	<li class="li2"><a href="<?php echo U('Index/Shop/index');?>" >购物车<span class="zongshuliang">    <?php if($_SESSION[cart][total_rows]){ ?><?php echo $_SESSION[cart][total_rows];?><?php }else{ ?>0<?php } ?></span> 件</a></li>
    			<li class="li1"><img src="http://127.0.0.1/my/wasai/Static/public/images/logo.png" alt="" /></li>
    			
    		 </ul>
    	   </div>
    	</div>
    	<div class="top2">
    		<div class="top4">
    			<a class="wosai" href=""><img src="" alt="" /></a>
	    	   	 <ul class="caidan">
	    			<li class="li1"><a href="<?php echo U('Index/Index/index');?>"></a></li>
	    			<li class="li2"><a href="<?php echo U('Index/Daohang/index');?>">市集</a></li>
	    			<li class="li2"><a href="<?php echo U('Index/List/index',array('cid'=>23));?>">服装</a></li>
	    			<li class="li2"><a href="<?php echo U('Index/List/index',array('cid'=>112));?>">饰品</a></li>
	    			<li class="li2"><a href="<?php echo U('Index/List/index',array('cid'=>124));?>">鞋包</a></li>
	    			<li class="li3"><a href="<?php echo U('Index/List/index',array('cid'=>137));?>">居家</a></li>
	    			<li class="li4"><a href="<?php echo U('Index/Index/index');?>"><img src="http://127.0.0.1/my/wasai/Static/public/images/wosai.png" alt="" /></a></li>
	    		 </ul>
	    		 <ul class="sousuo">
	    			<li class="li1">
	    				<form action="" method="post">
	    					<input class="sou" type="" placeholder="请输入要搜索的关键词" name="" value="" />
	    					<input class="tijiao" type="submit" value=""/>
	    				</form>
	    			</li>
	    			<li class="li2"><a href="<?php echo U('Index/List/index',array('cid'=>151));?>">数码</a></li>
	    			<li class="li3"><a href="<?php echo U('Index/List/index',array('cid'=>163));?>">文具</a></li>
	    		</ul>
    	   </div>
    	</div>
    </div>
    <!--顶部结束-->

    
    <!--内容展示开始-->
    <div class="content">
    	<div class="content_one">
    		<div class="hot">
    			<div class="hot1">
    				<a href="javascript:;" class="a1">最爱排行</a>
    				<a href="javascript:;" class="a2">热销排行</a>
    			</div>
    			<div class="box_x">
    				<div class="hot2">
	    				<div class="im">
	    					<img src="http://127.0.0.1/my/wasai/Static/public/images/content1.jpg"/>
	    				</div>
	    				<div class="zi1">
	    					<a href="" class="z1">经典款 重新上架 亚麻无袖... </a>
	    					<p>￥299.00</p>
	    				</div>
	    			</div>
	    			<div class="hot2">
	    				<div class="im">
	    					<img src="http://127.0.0.1/my/wasai/Static/public/images/content1.jpg"/>
	    				</div>
	    				<div class="zi1">
	    					<a href="">经典款 重新上架 亚麻无袖... </a>
	    					<p>￥299.00</p>
	    				</div>
	    			</div>
	    			<div class="hot2">
	    				<div class="im">
	    					<img src="http://127.0.0.1/my/wasai/Static/public/images/content1.jpg"/>
	    				</div>
	    				<div class="zi1">
	    					<a href="">经典款 重新上架 亚麻无袖... </a>
	    					<p>￥299.00</p>
	    				</div>
	    			</div>
	    			<div class="hot2">
	    				<div class="im">
	    					<img src="http://127.0.0.1/my/wasai/Static/public/images/content1.jpg"/>
	    				</div>
	    				<div class="zi1">
	    					<a href="">经典款 重新上架 亚麻无袖... </a>
	    					<p>￥299.00</p>
	    				</div>
	    			</div>
	    			<div class="hot2">
	    				<div class="im">
	    					<img src="http://127.0.0.1/my/wasai/Static/public/images/content1.jpg"/>
	    				</div>
	    				<div class="zi1">
	    					<a href="">经典款 重新上架 亚麻无袖... </a>
	    					<p>￥299.00</p>
	    				</div>
	    			</div>
	    			<div class="hot2">
	    				<div class="im">
	    					<img src="http://127.0.0.1/my/wasai/Static/public/images/content1.jpg"/>
	    				</div>
	    				<div class="zi1">
	    					<a href="">经典款 重新上架 亚麻无袖... </a>
	    					<p>￥299.00</p>
	    				</div>
	    			</div>
	    			<div class="hot2">
	    				<div class="im">
	    					<img src="http://127.0.0.1/my/wasai/Static/public/images/content1.jpg"/>
	    				</div>
	    				<div class="zi1">
	    					<a href="">经典款 重新上架 亚麻无袖... </a>
	    					<p>￥299.00</p>
	    				</div>
	    			</div>
	    			<div class="hot2">
	    				<div class="im">
	    					<img src="http://127.0.0.1/my/wasai/Static/public/images/content1.jpg"/>
	    				</div>
	    				<div class="zi1">
	    					<a href="">经典款 重新上架 亚麻无袖... </a>
	    					<p>￥299.00</p>
	    				</div>
	    			</div>
	    			
    			</div>
    		</div>
    		<div class="content2">
    			<img src="http://127.0.0.1/my/wasai/<?php echo $detail['big'];?>"/>
    		</div>
    		<div class="content3">
    			<div class="title">
    				<span><?php echo $goods['gname'];?></span>
    				<input type="hidden" name="gid" id="gid" value="<?php echo $goods['gid'];?>" />
    				<input type="hidden" name="name" id="name" value="<?php echo $goods['gname'];?>" />
    			</div>
    			<div class="jiage">
    				<span class="s1">价&nbsp;&nbsp;&nbsp;&nbsp;格：</span>
    				<span class="s2">￥<?php echo $goods['shopprice'];?>.00</span>
    				<input type="hidden" name="price" id="price" value="<?php echo $goods['shopprice'];?>" />
    			</div>
    			
    			<div class="yun">
    				<span class="s1">评&nbsp;&nbsp;&nbsp;&nbsp;价：</span>
    				<span class="s2">好评率99.12% | <a href="" class="speak">已有114条评价</a></span>
    			</div>
    			<?php foreach ($temp as $k=>$v){?>
    			<ul class="spec">
    				<li class="li1">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $v['taname'];?> : </li>
    				<?php foreach ($v['gtvalue'] as $kk=>$vv){?>
	    				<li>
	    					<a href="javascript:;" spec="<?php echo $kk;?>"><label for="options<?php echo $kk;?>"><?php echo $vv;?></label></a>
	    					<input type="checkbox" name="options[]" id="options<?php echo $kk;?>" value="<?php echo $kk;?>" style="display: none;"/>
	    				</li>
	    				
	    			<?php }?>
    			</ul>
    			<?php }?>
    			
    			<div class="shop">
    				<span class="gou">购买数量 :</span> 
    				<a href="javascript:;" class="a1"> -</a>
    				<input type="text" name="number" id="number" class="number" value="1" />
    				<a href="javascript:;" class="a2"> +</a>
    				<span class="cun">库存<span class="num"><?php echo $number;?></span>件</span>
    			</div>
    			<div class="join">
    				<a href="javascript:;" class="joincat">加入购物车</a>
    				<div class="join1">
    					<ul class="in1">
    						<li class="i1"></li>
    						<li class="i2"><span>宝贝已成功加入到购物车!</span></li>
    						<li class="i3"><a href="javascript:;" class="guanbi"></a>X关闭</li>
    					</ul>
    					<ul class="in2">
    						<li>购物车共有<span class="shuliang"></span>件宝贝，合计<span class="zongjia"></span>元</li>
    					</ul>
    					<ul class="in3">
    						<li><a href="<?php echo U('Index/Shop/index');?>" class="gocat"></a></li>
    					</ul>
    				</div>
    			</div>
    			
    		</div>
    		<ul class="xiangqing">
    				<li><a href="javascript:void(0)" class="a1">产品详情</a></li>
    				<li><a href="javascript:void(0)" class="a2">买家评价</a></li>
    		</ul>
    		
    		<div class="show_content">
    			<img src="http://127.0.0.1/my/wasai/Static/public/images/content5.jpg"/>
    			<img src="http://127.0.0.1/my/wasai/Static/public/images/content5.jpg"/>
    		</div>
    		
    		<div class="biaoqianyun">
    			<div class="biaoqianyun1">
    				<span>标签</span>
    				<ul>
    					<li><p>棉麻</p></li>
    					<li><p>圆领</p></li>
    				</ul>
    			</div>
    			<div class="biaoqianyun1 and">
    				<span>材质</span>
    				<ul>
    					<li><p>棉</p></li>
    					
    				</ul>
    			</div>
    		</div>
    	</div>
    </div>
    
    
   <!--内容展示结束-->
    <!--底部-->
    <div class="foot">
    	<div class="gaoduan">
    		<span>高端定制上哇噻网</span>
    	</div>
    	<div class="di">
    		<ul>
    			<li><a href="">关于我们</a></li>
    			<li><a href="">联系我们</a></li>
    			<li><a href="">媒体报道</a></li>
    			<li><a href="">创意画报</a></li>
    			<li><a href="">招贤纳士</a></li>
    			<li><a href="">版权保护</a></li>
    			<li><a href="">用户条款</a></li>
    			<li><a href="">隐私声明</a></li>
    			<li><a href="">友情链接</a></li>
    			<li><a href="">网站地图</a></li>
    			<li><a href="">帮助中心</a></li>
    			<li><a href="">手工客</a></li>
    		</ul>
    		<ul class="u1">
    			<li>北京光年创艺信息技术有限公司 WowSai.com Copyright© 2008-2013 [京ICP备10020900][京公网安备11010502026420][京ICP证090011号]</li>
    		</ul>
    		<div class="tu">
    		   <ul>
    		   	    <li><img src="http://127.0.0.1/my/wasai/Static/public/images/2.png" alt="" /></li>
    		   	    <li><img src="http://127.0.0.1/my/wasai/Static/public/images/1.png" alt="" /></li>
    		   	    <li><img src="http://127.0.0.1/my/wasai/Static/public/images/3.png" alt="" /></li>
    		   </ul>
    	    </div>
    	</div>
    	
    </div>
    
    <div class="ding">
    	<a href="javascript:;"></a>
    </div>
    
</body>
</html>

